<script setup>
import { ref,onMounted } from 'vue'
import { pageJdAndJstSum } from '@/api/data-check/jdAndJstSum/index'

//表格数据和列数据
const tableData = ref([])


const getJdAndJstSumData = async () =>{
  let res = await pageJdAndJstSum()
  tableData.value = res.rows[0] ?? []
}

onMounted(()=>{
  getJdAndJstSumData()
})


</script>

<template>
  <el-table :data="tableData.tableList" style="width: 100%">
    <el-table-column :fixed="index === 0?true:false" v-for="(item,index) in tableData.columnList" width="200" :key="index" :label="item.label" align='center'>
      <template #default="scope">
        <div :class="{'bg-red':tableData.tableList[tableData.tableList.length -1][item.prop] && index > 0}">{{ scope.row[item.prop] }}</div>
      </template>
     </el-table-column>
  </el-table>
</template>

<style scoped>
.bg-red{
  color:white;
  background-color: red;
}
</style>
